# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=dnscrypt-wrapper
pkgver=0.4.2
pkgrel=3
pkgdesc="dnscrypt wrapper (server-side dnscrypt proxy), which helps to add dnscrypt support to any name resolver"
url="https://github.com/Cofyc/dnscrypt-wrapper"
arch="all"
license="MIT"
makedepends="libevent-dev libsodium-dev bsd-compat-headers autoconf automake libtool"
source="https://github.com/cofyc/dnscrypt-wrapper/archive/v$pkgver/dnscrypt-wrapper-$pkgver.tar.gz"

prepare() {
	default_prepare
	autoreconf -fi
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make -C tests
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="f45afc6e0468c48ad9ded54cfd7d5314c68d49afda5faf3c7c3b6f8f41f77501565967ba6666f3723ba735c8d7f8d98a7777010a4fcf215b3d76707411243400  dnscrypt-wrapper-0.4.2.tar.gz"
